package com.dongjiantong.user.enums;

/**
 * Created by mz on 5/7/17.
 */
public enum AppUserRole {

    BREED_FACTORY_ADMIN(2009, "养殖场管理员"),
    BREED_FACTORY_NORMAL(2010, "养殖场操作员"),
    BUTCHER_FACTORY_ADMIN(2011, "屠宰场管理员"),
    BUTCHER_FACTORY_NORMAL(2012, "屠宰场操作员"),
    VETERINARIAN(2006, "官方兽医"),
    ASSOCIATION_INSPECTOR(2007, "协检员"),
    PREVENTION_COORDINATOR(2008, "乡村防疫员"),
    CITY_INSPECTOR(2004, "市级查看员"),
    COUNTY_INSPECTOR(2005, "县级查看员"),
    UN_SCALE_BREED_FACTORY_COMMON(10, "散户账号"),




    /*
        无害化的相关角色（集中处理）
    */
    STREAM_BUSINESS(100,"物流端的人"),
    COLLECT_POINT(101,"收集点的人"),
    /*
     执法办案相关角色
    */
    CASE_REGISTER(11, "执法办案登记员"),
    CASE_TRANSACT(12, "执法办案办案员"),
    CASE_APPROVAL(13, "执法办案审批员"),
    CASE_ADMINISTRATOR(14, "执法办案后台管理员"),

    /*
        保险相关角色
     */
    INS_CITY_INSPECTOR(21, "保险市级查看员"),
    INS_COUNTY_INSPECTOR(22, "保险县级查看员"),
    INS_NORMAL(23, "保险操作员"),
    INS_ADMIN(24, "保险派发员");

    private final Integer value;
    private final String description;

    AppUserRole(Integer value, String description) {
        this.value = value;
        this.description = description;
    }

    public static AppUserRole from(Integer value) {
        for (AppUserRole appUserRole : AppUserRole.values()) {
            if (appUserRole.value.equals(value)) {
                return appUserRole;
            }
        }
        return null;
    }

    public Integer value() {
        return this.value;
    }

    @Override
    public String toString() {
        return description;
    }
}
